﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using System.Web.Configuration;
using System.Web.Mvc;
using Small.Test;

using Small.Util.Reflection;
using SmallProject.Models.CutstomeUI;
using System.Reflection;
using System.Threading;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics;

namespace SmallProject.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/


        
        public ActionResult Index()
        {
            
            Student student = new Student();
            student.Address = "4";
            student.Email = "A";
            student.Age = 3;
            student.StudentID = 2;
            student.StudentName = "B";

            RequiredAttribute required = new RequiredAttribute();
            required.ErrorMessage = "必填字段";
            required.Validate(student.StudentName,student.StudentName);
            student.Students = new Students();
            student.Students.StudentName = "B";
            ValidationAttribute validate = required; 
       
           
           

            Dictionary<string, string> studentInf = DefinationProperties.GetProperties<Student>(student);
            return View(student);
           
        }


        [HttpPost]
        public ActionResult Index(Student student)
        {

            Stopwatch stopwatch = new Stopwatch();
            stopwatch.Start();
            Student student1 = Query.Result<Student>(Request,null);
            stopwatch.Stop();
            long ss = stopwatch.Elapsed.Milliseconds;

            return View();
        }

        public ActionResult List() 
        {
            return View();
        }

        public ActionResult Test() 
        {
            return View();
        }
    }
}
